/*
 * MonthViewPanel.java
 *
 * Created on Oct 19, 2011, 12:28:52 PM
 */
package carassius.GUI.Calendar;

import carassius.BLL.Events.ArrayListWithEvents;
import carassius.BLL.GregorianCalendarWithEvents;
import java.util.GregorianCalendar;

/**
 *
 * @author siebz0r
 */
public class MonthViewPanel
		extends javax.swing.JPanel
{
	//<editor-fold defaultstate="collapsed" desc="Fields">
	private GregorianCalendarWithEvents _calendar;
	private ArrayListWithEvents<Long> _markedDates;
	//</editor-fold>

	//<editor-fold defaultstate="collapsed" desc="Constructors">
	public MonthViewPanel()
	{
		this(new GregorianCalendar().get(GregorianCalendar.MONTH), new GregorianCalendar().get(GregorianCalendar.YEAR));
	}

	public MonthViewPanel(int month, int year)
	{
		this(new GregorianCalendarWithEvents(year, month, new GregorianCalendar().get(GregorianCalendar.DATE)), new ArrayListWithEvents<Long>());
	}

	public MonthViewPanel(GregorianCalendarWithEvents calendar, ArrayListWithEvents<Long> markedDates)
	{
		_calendar = calendar;
		_markedDates = markedDates;
		initComponents();
	}
	//</editor-fold>

	//<editor-fold defaultstate="collapsed" desc="Public Properties">
	public int getMonth()
	{
		return _calendar.get(GregorianCalendar.MONTH);
	}

	public void setMonth(int month)
	{
		_calendar.set(GregorianCalendar.MONTH, month);
	}

	public int getYear()
	{
		return _calendar.get(GregorianCalendar.YEAR);
	}

	public void setYear(int year)
	{
		_calendar.set(GregorianCalendar.YEAR, year);
	}

	public void setDay(int day)
	{
		_calendar.set(GregorianCalendar.DATE, day);
	}

	public void setDate(int year, int month, int day)
	{
		_calendar.set(year, month, day);
	}
	//</editor-fold>

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        uxWeekViewPanel1 = new carassius.GUI.Calendar.WeekViewPanel(_calendar, _markedDates, 0);
        uxWeekViewPanel2 = new carassius.GUI.Calendar.WeekViewPanel(_calendar, _markedDates, 1);
        uxWeekViewPanel3 = new carassius.GUI.Calendar.WeekViewPanel(_calendar, _markedDates, 2);
        uxWeekViewPanel4 = new carassius.GUI.Calendar.WeekViewPanel(_calendar, _markedDates, 3);
        uxWeekViewPanel5 = new carassius.GUI.Calendar.WeekViewPanel(_calendar, _markedDates, 4);
        uxWeekViewPanel6 = new carassius.GUI.Calendar.WeekViewPanel(_calendar, _markedDates, 5);

        setMaximumSize(new java.awt.Dimension(189, 162));
        setMinimumSize(new java.awt.Dimension(189, 162));
        setName("Form"); // NOI18N
        setPreferredSize(new java.awt.Dimension(189, 162));
        setLayout(new java.awt.GridLayout(6, 1));

        uxWeekViewPanel1.setName("uxWeekViewPanel1"); // NOI18N
        add(uxWeekViewPanel1);

        uxWeekViewPanel2.setName("uxWeekViewPanel2"); // NOI18N
        add(uxWeekViewPanel2);

        uxWeekViewPanel3.setName("uxWeekViewPanel3"); // NOI18N
        add(uxWeekViewPanel3);

        uxWeekViewPanel4.setName("uxWeekViewPanel4"); // NOI18N
        add(uxWeekViewPanel4);

        uxWeekViewPanel5.setName("uxWeekViewPanel5"); // NOI18N
        add(uxWeekViewPanel5);

        uxWeekViewPanel6.setName("uxWeekViewPanel6"); // NOI18N
        add(uxWeekViewPanel6);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private carassius.GUI.Calendar.WeekViewPanel uxWeekViewPanel1;
    private carassius.GUI.Calendar.WeekViewPanel uxWeekViewPanel2;
    private carassius.GUI.Calendar.WeekViewPanel uxWeekViewPanel3;
    private carassius.GUI.Calendar.WeekViewPanel uxWeekViewPanel4;
    private carassius.GUI.Calendar.WeekViewPanel uxWeekViewPanel5;
    private carassius.GUI.Calendar.WeekViewPanel uxWeekViewPanel6;
    // End of variables declaration//GEN-END:variables
}
